package com.org.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.groups.Default;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.URL;

import javax.swing.plaf.nimbus.State;
import java.time.LocalDateTime;

/**
 * ClassName: NormalUser
 * Package: com.org.pojo
 * Description:
 *
 * @Author Origin
 * @Create 2024/2/2 0:42
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("normal_user")
public class NormalUser {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id; //主键id

    private Integer userType;   //账户类型默认为 1

    private String username;   //用户名

    private String password;    //密码

    private String name;    //真实姓名
    private String identityId; //身份证号

//    @URL(groups = UpdateIdentity.class)
    private String identityIdImg;   //身份证照片

//    @NotEmpty(groups = Update.class)
    private String phone;   //电话号

//    @NotEmpty(groups = Update.class)
    private String sex; //性别

//    @URL
    private String userPic; //头像

    private Integer age;    //年龄

    @TableField(value = "is_oldman")
    private String isOldman;   //是不是老年人

    @TableField(value = "is_volunteer")
    private String isVolunteer;    //是不是志愿者

//    @NotNull(groups = Update.class)
    private Integer communityId;    //所在社区

    private String chainKey;    //区块链编码

    private String state;   //实名认证状态
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime createTime;//创建时间

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime updateTime;//更新时间

    private String oldmanMatrial;

    private String volunteerMatrial;

    public interface Update extends Default {}

    public interface UpdateIdentity extends Default {}
}
